SpaghettiPage.render   B
last analyzed

Complexity

Conditions 1

Size

Total Lines 56
Code Lines 50

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 50
dl 0
loc 56
c 0
b 0
f 0
rs 8.6363
cc 1

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
import { graphql } from "gatsby";
2
import { GatsbyImage } from "gatsby-plugin-image";
3
import React, { Component } from "react";
4
5
import SEO from "../components/seo";
6
import Layout from "../layouts/index";
7
8
class SpaghettiPage extends Component {
9
  render() {
10
    const { affiche } = this.props.data;
11
    return (
12
      <Layout>
13
        <SEO
14
          lang="nl-BE"
15
          title="Spaghettislag Ultra's 55"
16
          description="Spaghettislag Ultra's 55"
17
          path={this.props.location.pathname}
18
        />
19
        <div className={`limited-width_wrapper`}>
20
          <header>
21
            <h1>Spaghettislag ULTRA'S 55</h1>
22
            <h2>Supportersclub KCVV Elewijt</h2>
23
          </header>
24
          <main>
25
            <p>
26
              Op zondag 3 oktober 2021 organiseert de supportersclub "Ultra's
27
              55" zijn eerste spaghettislag.
28
            </p>
29
            <p>
30
              Kom tussen 11:00 en 13:30 smullen van onze heerlijke spaghetti
31
              bolognese in de kantine van KCVV Elewijt.
32
            </p>
33
            <p>
34
              Prijs is 10 euro voor volwassenen en 7 euro voor een kinderportie.
35
            </p>
36
            <p>
37
              Vooraf en nadien spelen onze drie seniorploegen hun
38
              competitiewedstrijd thuis:
39
              <ul>
40
                <li>10:15 - Zondagsreserven vs FC Ramsdonk</li>
41
                <li>14:00 - KCVV Elewijt B vs VC Groot-Dilbeek B</li>
42
                <li>15:00 - KCVV Elewijt A vs KFC Baal</li>
43
              </ul>
44
            </p>
45
            <p>Inschrijven kan, maar is niet verplicht:</p>
46
            <tbkr-bm-widget
47
              restaurant-id="34742560"
48
              source="website"
49
              use-modal="0"
50
              lang="nl"
51
              theme="light"
52
            ></tbkr-bm-widget>
53
            <script src="https://reservations.tablebooker.com/tbkr-widget-import.min.js"></script>
54
          </main>
55
          <footer>
56
            <GatsbyImage
57
              image={{
58
                ...affiche.childImageSharp.gatsbyImageData,
59
              }}
60
              alt="Spaghettislag KCVV Ultra's 55"
61
            />
62
          </footer>
63
        </div>
64
      </Layout>
65
    );
66
  }
67
}
68
69
export const pageQuery = graphql`
70
  query {
71
    affiche: file(name: { eq: "spaghetti" }) {
72
      ...KCVVFullWidth
73
    }
74
  }
75
`;
76
77
export default SpaghettiPage;
78